﻿using Dyao.Book.Contract;

namespace Dyao.Book.Application.Abstractions
{
    public interface IBookCatalogueApplication
    {
        /// <summary>
        /// 获取目录内容
        /// </summary>
        /// <param name="bookId">书籍编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<BookChapterDto> GetListByBookIdAsync(string bookId, CancellationToken cancellationToken);

        /// <summary>
        /// 匹配书籍章节源
        /// </summary>
        /// <param name="bookId">书籍编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task<bool> MatchChapterSourceAsync(string bookId, CancellationToken cancellationToken);

        /// <summary>
        /// 同步书籍章节目录
        /// </summary>
        /// <param name="taskCenter">任务中心</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task SyncBookChapterAsync(TaskCenterDto taskCenter, CancellationToken cancellationToken);

        /// <summary>
        /// 同步书籍章节目录
        /// </summary>
        /// <param name="craw">章节目录信息</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task SyncBookChapterAsync(CrawCatalogueDto craw, CancellationToken cancellationToken);

        /// <summary>
        /// 同步书籍免费章节内容
        /// </summary>
        /// <param name="bookId">书籍编号</param>
        /// <param name="cancellationToken">取消令牌</param>
        /// <returns></returns>
        Task SyncBookFreeChapterContentAsync(string bookId, CancellationToken cancellationToken);
    }
}
